package com.piece.module.spider.support;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel("磁力链接信息")
@NoArgsConstructor
@AllArgsConstructor
public class MagnetResult {

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("地址")
    private String magnet;

    @ApiModelProperty("日期")
    private String date;

    @ApiModelProperty("大小")
    private String size;

    @ApiModelProperty("详情地址")
    private String detailUrl;

    @ApiModelProperty("提取码")
    private String accessCode;

    @ApiModelProperty("文件")
    private List<File> files = new ArrayList<>();

    public void addFile(String name, String size) {
        files.add(new File(name, size));
    }

    @Data
    @ApiModel("磁力文件信息")
    @AllArgsConstructor
    class File {
        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("大小")
        private String size;
    }
}
